import { S } from '../../s';
import { IPSTextItem } from './ipstext-item';
import { PSRawItemImplBase } from './psraw-item-impl-base';

export class PSTextItemImpl extends PSRawItemImplBase implements IPSTextItem {
  get caption(): string {
    return this.M.caption;
  }

  get hAlign(): 'LEFT' | 'CENTER' | 'RIGHT' | 'JUSTIFY' {
    return this.M.hAlign || 'LEFT';
  }

  get renderMode():
    | 'TEXT'
    | 'HEADING1'
    | 'HEADING2'
    | 'HEADING3'
    | 'HEADING4'
    | 'HEADING5'
    | 'HEADING6'
    | 'PARAGRAPH' {
    return this.M.renderMode;
  }

  get vAlign(): 'TOP' | 'MIDDLE' | 'BOTTOM' {
    return this.M.vAlign || 'MIDDLE';
  }

  get wrapMode(): 'WRAP' | 'NOWRAP' {
    return this.M.wrapMode || 'NOWRAP';
  }
  get cls(): string {
    return 'PSTextItemImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._3a4 || cls == S._3b2) return true;
    return super.instanceof(cls);
  }
}
